home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{B190576C-254A-11D2-B61E-C80424DEEF17}#51.0#0"; "LCocx.ocx"
- Begin VB.Form Form1
- Caption = "Tray Icon Demo"
- ClientHeight = 1800
- ClientLeft = 132
- ClientTop = 420
- ClientWidth = 5688
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 1800
- ScaleWidth = 5688
- StartUpPosition = 2 'CenterScreen
- Begin LCocx98.LCocx LCocx1
- Left = 960
- Top = 1320
- _ExtentX = 656
- _ExtentY = 656
- End
- Begin VB.PictureBox Picture1
- AutoSize = -1 'True
- BorderStyle = 0 'None
- Height = 384
- Left = 360
- Picture = "Form1.frx":0000
- ScaleHeight = 384
- ScaleWidth = 384
- TabIndex = 3
- Top = 1200
- Width = 384
- End
- Begin VB.CommandButton cmdremove
- Caption = "Remove Tray Icon"
- Height = 495
- Left = 3720
- TabIndex = 2
- Top = 360
- Width = 1632
- End
- Begin VB.CommandButton cmdedit
- Caption = "Edit Tray Icon"
- Height = 495
- Left = 2040
- TabIndex = 1
- Top = 360
- Width = 1632
- End
- Begin VB.CommandButton cmdshow
- Caption = "Show Tray Icon"
- Height = 495
- Left = 360
- TabIndex = 0
- Top = 360
- Width = 1632
- End
- Begin VB.Label lblspace
- AutoSize = -1 'True
- Caption = "The Drive C: has MB Free"
- Height = 192
- Left = 2280
- TabIndex = 4
- Top = 1200
- Width = 1836
- End
- Begin VB.Menu mnufile
- Caption = "File"
- Begin VB.Menu mnusystemtray
- Caption = "Tray Icon"
- Visible = 0 'False
- Begin VB.Menu mnustatus
- Caption = "Status"
- End
- Begin VB.Menu mnucall
- Caption = "Call"
- End
- Begin VB.Menu mnuformat
- Caption = "Format"
- Begin VB.Menu mnuwindow
- Caption = "Window"
- End
- Begin VB.Menu mnuline1
- Caption = "-"
- End
- Begin VB.Menu mnutools
- Caption = "Tools"
- End
- Begin VB.Menu mnuview
- Caption = "View"
- End
- End
- End
- Begin VB.Menu mnuexit
- Caption = "exit"
- End
- End
- Begin VB.Menu mnusnsu
- Caption = "Help"
- Begin VB.Menu mnuabout
- Caption = "About"
- End
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cmdshow_Click()
- 'Show the Icon, if the icon is ommited, the form's icon will be used
- Call LCocx1.Traycon(Me, True, Picture1.Picture, "LCocx '98 Tray Icon (Double-Click to Show the Form)") 'Show Tray Icon
- Me.Hide
- End Sub
- Private Sub cmdedit_Click()
- s = InputBox("Enter String:")
- Call LCocx1.Traycon(Me, True, , s) 'Edit ToolTip
- End Sub
- Private Sub cmdremove_Click()
- Call LCocx1.Traycon(Me, False, , "") 'Remove from the Tray
- End Sub
- Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
-
- Select Case LCocx1.TrayconClick(X, Y)
- Case "LeftButtonDblClick" 'doubleclick
- Me.Show
- Case "LeftButtonUp" 'left click
- 'To do
- Case "MiddleButtonUp" 'middle-button-click
- 'To do
- Case "RightButtonUp" 'right-click
- Me.PopupMenu mnusystemtray 'show menu
- End Select
- End Sub
- Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
- Call LCocx1.Traycon(Me, False, , "") 'Remove the icon on exit
- End Sub
- Sub mnuview_click()
- 'from the popup menu
- Me.Show
- End Sub
- Private Sub lblspace_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
- 'display drive C's free space
- Free = LCocx1.DiskFree("C:")
- lblspace = "The Drive C: has " & Free & " MB Free"
- End Sub
-